//Toolbar code
function ChangeChord(ChordMain,temp) 
{
	var	ChordChar = new Array("","C","C#","D","D#","E","F","F#","G","G#","A","A#","B");
	function GetChordNum(Chord)
	{
		var i = 0;
		{
			for (i=1;i<13;i++)
			{
				if (ChordChar[i]==Chord)
				{
					break;
				}
			}
			return i;
		}
	}
	function GetChordChar(Chord) 
	{
		if(( Chord.length >1) && (Chord.charAt(1) == "#".charAt(0)))
		{
			return Chord.charAt(0)+Chord.charAt(1);
		}
		else 
		{
			if ((Chord.length > 1) && (Chord.charAt(0) == "B".charAt(0)) && (Chord.charAt(1) == "b".charAt(0)))
			{
				return "A#";
			}
			return Chord.charAt(0);
		}
	}
	function GetChordChar2(Chord1,Chord2) 
	{
		if(( Chord1.length >1) && (Chord1.charAt(1) == "#".charAt(0)))
		{
			return Chord2+Chord1.substring(2);
		}
		else 
		{
			return Chord2+Chord1.substring(1);
		}
	}
	function MainProcess(ChordM,tempM) 
	{
		Chord = GetChordChar(ChordM);
		tempM = tempM % 12;
		if ((GetChordNum(Chord) + tempM > 12) || (GetChordNum(Chord) + tempM <=0))
		{
				tempM = Math.abs(12 - Math.abs(GetChordNum(Chord) + tempM))-1;
				Chord = "C";
		}
		tmp = ChordChar[GetChordNum(Chord) + tempM];
		if (ChordMain.length >1)
			{
				return GetChordChar2(ChordM,tmp);
			}
		else 
			{
				return tmp;
			}
	}
	
	//main Function
	if (ChordMain.match("Bb"))
	{
		ChordMain = ChordMain.replace("Bb","A#");
	}
	if (ChordMain.match("/"))
	{
		var x = ChordMain.search("/");
		tmp1 = MainProcess(ChordMain.substring(0,x),temp);
		tmp2 = MainProcess(ChordMain.substring(x+1),temp);
		return tmp1+"/"+tmp2;
	}
	else
	{
		return MainProcess(ChordMain,temp);
	}
}